package com.ruoyi.web.controller.chongyuhui;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.system.domain.chongyuhui.TbOrderEntity;
import com.ruoyi.system.service.congyuhui.TbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * (TbOrder)表控制层
 *
 * @author makejava
 * @since 2024-05-29 23:07:22
 */
@RestController
@RequestMapping("tbOrder")
public class TbOrderController extends BaseController {


    @Autowired
    private TbOrderService tbOrderService;

    /**
     * 新增
     */
    @PostMapping("insert")
    public AjaxResult insert(@RequestBody TbOrderEntity tbOrderEntity) {
        tbOrderService .insert(tbOrderEntity);
        return AjaxResult.success("新增成功");
    }

    /**
     * 批量新增
     */
    @PostMapping("batchInsert")
    public AjaxResult batchInsert(@RequestBody List<TbOrderEntity> tbOrderEntities) {
        tbOrderService .batchInsert(tbOrderEntities);
        return AjaxResult.success("新增成功");
    }

    /**
     * 删除
     */
    @PostMapping("delete")
    public AjaxResult delete(@RequestBody TbOrderEntity tbOrderEntity) {
        tbOrderService .delete(tbOrderEntity);
        return AjaxResult.success("删除成功");
    }

    /**
     * 批量删除
     */
    @PostMapping("batchDelete")
    public AjaxResult batchDelete(@RequestBody List<TbOrderEntity> tbOrderEntities) {
        tbOrderService .batchDelete(tbOrderEntities);
        return AjaxResult.success("删除成功");
    }

    /**
     * 编辑
     */
    @PostMapping("update")
    public AjaxResult update(@RequestBody TbOrderEntity tbOrderEntity) {
        tbOrderService .update(tbOrderEntity);
        return AjaxResult.success("修改成功");
    }

    /**
     * 批量编辑
     */
    @PostMapping("batchUpdate")
    public AjaxResult batchUpdate(@RequestBody List<TbOrderEntity> tbOrderEntities) {
        tbOrderService .batchUpdate(tbOrderEntities);
        return AjaxResult.success("修改成功");
    }

    /**
     * 查询
     */
    @GetMapping("query")
    public TableDataInfo query(TbOrderEntity tbOrderEntity) {
        PageUtils.startPage();
        return getDataTable(tbOrderService .query(tbOrderEntity));
    }








}

